package cn.mulanbay.persistent.mapper;

import cn.mulanbay.persistent.entity.DatabaseClean;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * Mapper 接口
 *
 * @author fenghong
 * @create 2022-01-16 10:00
 */
public interface DatabaseCleanMapper extends BaseMapper<DatabaseClean> {

    /**
     * 获取有效的列表
     * @return
     */
    List<DatabaseClean> getActiveList();

    long getCounts(String tableName);

    void truncateTable(String tableName);

    long deleteData(@Param("tableName")String tableName,@Param("dateField") String dateField,@Param("compareDate") LocalDateTime compareDate,@Param("extraCondition") String extraCondition);
}
